<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/course-api/health', function () use ($router) {
    return 'Course API';
});

$router->group(['prefix' => 'course-api'], function() use ($router) {
    $router->group(['middleware' => ['oauth.consumer:student', 'oauth.scope:student']], function () use ($router) {
        $router->get('/guides', 'GuideController@index');
        $router->get('/courses', 'CourseController@index');
        $router->get('/levels/{level}/preview', 'CourseController@preview');
    });
    $router->get('/share/lesson', 'LessonController@share');
    $router->get('/levels', 'CourseController@levels');
});
